home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / pas_all.zip / TI425.ASC < prev    next >
Text File  |  1992-08-12  |  2KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  425
  9.   VERSION  :  4.0
  10.        OS  :  PC-DOS
  11.      DATE  :  APRIL 5, 1988                            PAGE  :  1/1
  12.  
  13.     TITLE  :  MODIFYING HERCPRESENT IN GRAPHIX TOOLBOX 4.0
  14.  
  15.  
  16.  
  17.  
  18.   Turbo  Pascal  stores  function results in a special area. In the
  19.   case of a Boolean  function  result, it is stored in BP-0001. The
  20.   exit code of a function then moves the value stored there to AL.
  21.  
  22.   The code presented in function  HercPresent  computes  the proper
  23.   value for the function result,  but never places it into BP-0001,
  24.   and just keeps the value in AL. On some machines, this  can cause
  25.   a range check error on assignment of the function result. The
  26.  
  27.  
  28.   The  old  inline  statement of the Function  HercPresent  was  as
  29.   follows:
  30.  
  31.            $26/$88/$0E/$FF/$3F/  {          MOV       ES:[3FFFH],CL
  32.   }
  33.            $C3/                                    {            RET
  34.   }
  35.            $30/$C0);                        { L4:  XOR        AL,AL
  36.   }
  37.                                  {                              L7:
  38.   }
  39.  
  40.   end; { HercPresent }
  41.  
  42.   Adding the three inline commands  ( /$88/$46/$FF ) before the end
  43.   of  the inline statement places the value in  AL  into  the  area
  44.   where Turbo will look for the function result.
  45.  
  46.   The new code should look as follows:
  47.  
  48.            $26/$88/$0E/$FF/$3F/  {          MOV       ES:[3FFFH],CL
  49.   }
  50.            $C3/                                    {            RET
  51.   }
  52.            $30/$C0/                      {  L4:    XOR        AL,AL
  53.   }
  54.            $88/$46/$FF);           {  L7:    MOV       [BP-0001],AL
  55.   }
  56.  
  57.   end; { HercPresent }
  58.  
  59.   DISCLAIMER:  You  have  the  right   to   use   this  technical
  60.   information subject to the  terms  of  the  No-Nonsense License
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  425
  75.   VERSION  :  4.0
  76.        OS  :  PC-DOS
  77.      DATE  :  APRIL 5, 1988                            PAGE  :  2/1
  78.  
  79.     TITLE  :  MODIFYING HERCPRESENT IN GRAPHIX TOOLBOX 4.0
  80.  
  81.  
  82.  
  83.  
  84.   Statement that you  received  with the Borland product to which
  85.   this information pertains.
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.